<?php
include_once 'global.php';
include_once 'helper.php';
include_once 'user.php';
authenticate();
if(isset($_POST['submit'])){
	include_once 'dao/TeamDao.php';
	include_once 'dao/RegistrationDao.php';
	include_once 'user.php';

	$dao = new TeamDao();
	$regdao = new RegistrationDao();

	if (($_POST['reg_type'] == 'team')) {
		$team = new Activity('0', $_POST['teamName'], $_POST['sport'], $_SESSION['user'], $_POST['level']);
		$dao->insert($team);
		$regdao->insert( $team->getId(), 1115 );
	}else{
		//should be able to register individuals, not yet implemented
	}
	$processed = "success";


}
include '../view/register.php';
?>
